<?php

namespace app\admin\model\recharge;

use think\Model;


class Bill extends Model
{

    

    

    // 表名
    protected $table = 'recharge_bill';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'is_send_text',
        'is_check_text',
        'is_success_text'
    ];
    

    
    public function getIsSendList()
    {
        return ['0' => __('Is_send 0'), '1' => __('Is_send 1')];
    }

    public function getIsCheckList()
    {
        return ['0' => __('Is_check 0'), '1' => __('Is_check 1')];
    }

    public function getIsSuccessList()
    {
        return ['0' => __('Is_success 0'), '1' => __('Is_success 1')];
    }


    public function getIsSendTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_send']) ? $data['is_send'] : '');
        $list = $this->getIsSendList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsCheckTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_check']) ? $data['is_check'] : '');
        $list = $this->getIsCheckList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsSuccessTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_success']) ? $data['is_success'] : '');
        $list = $this->getIsSuccessList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
